package org.nuist.repository;

import org.nuist.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserRepository extends JpaRepository<User,Integer> {

    @Query(name = "findUserByName",nativeQuery = true,value = "select * from `web_shell`.user where user_name=:name")
    public User findUserByName(@Param("name") String name);

    @Query(name = "findUserById",nativeQuery = true,value = "select * from `web_shell`.user where user_id=:id")
    public User findUserById(@Param("id") Integer id);

}
